package com.oglvip.business.remote.service.api;

import com.oglvip.business.dto.ApplyInfoFormDto;
import com.oglvip.business.dto.DeliveryFormDto;
import com.oglvip.business.dto.ResponseData;
import com.oglvip.business.remote.service.Targets;
import com.oglvip.business.remote.service.entity.Delivery;
import com.oglvip.business.remote.service.entity.PageData;
import com.oglvip.business.remote.service.entity.StoreDetail;
import com.oglvip.business.remote.service.entity.StoreType;
import com.oglvip.business.remote.support.annotation.BodyParam;
import com.oglvip.business.remote.support.annotation.RestClient;
import com.oglvip.business.remote.support.request.ContentTypes;

import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import java.util.List;

/**
 * @auther hanchao
 * @date 2016/12/14 13:23
 */
@RestClient(Targets.PLATFORM_API)
@Path("/api/store")
public interface StoreService {
    /**
     * idcard-身份证 license-营业执照 face-门头(logo)图片 inner-店内图片
     * @param imgData
     * @param type
     * @return
     */
    @POST
    @Path("/img/upload")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData uploadImg(@FormParam("imgData") String imgData, @FormParam("type") String type);


    @POST
    @Path(("/type/list"))
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData<List<StoreType>> getStoreTypes();


    @POST
    @Path("/apply")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData apply(@BodyParam ApplyInfoFormDto info);

    @POST
    @Path("/modify")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData modify(@BodyParam ApplyInfoFormDto info);

    @POST
    @Path("/detail")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData<StoreDetail> getDetail(@FormParam("storeId")Integer storeId);

    @POST
    @Path("/delivery/detail")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData<Delivery> getDelivery(@FormParam("ticket")String ticket);

    @POST
    @Path("/delivery/info/set")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData setDelivery(@BodyParam DeliveryFormDto dto);

    @POST
    @Path("/balance/list")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData<PageData> listBalance(@FormParam("ticket") String ticket, @FormParam("storeId") int storeId,
                                       @FormParam("balanceNo") String balanceNo, @FormParam("startTime") String startTime,
                                       @FormParam("endTime") String endTime, @FormParam("start") Integer start,
                                       @FormParam("size") Integer size);

    @POST
    @Path("/banks")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData getBanks();

    @POST
    @Path("/bank/detail")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData getBankInfo(@FormParam("ticket")String ticket,@FormParam("timestamp")Long timestatmp,@FormParam("sig")String sig);

    @POST
    @Path("/bank/info")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData setBankInfo(@FormParam("ticket")String ticket,@FormParam("bank")String bank,@FormParam("bankNo")String bankNo, @FormParam("bankMaster")String bankMaster,
                             @FormParam("timestamp")Long timestatmp,@FormParam("sig")String sig);

    @POST
    @Path("/cash/apply")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData applyCash(@FormParam("ticket")String ticket,@FormParam("money")Integer money,@FormParam("password")String password,
                           @FormParam("timestamp")Long timestatmp,@FormParam("sig")String sig);
}
